* China’s Foreign Aid Political Drivers: Lessons from a Novel Dataset of Mask Diplomacy in Latin America During the COVID-19 Pandemic
* Diego Telias and Francisco Urdinez
* Journal of Current Chinese Affairs


************************************************************

*Table 4. Descriptive statistics
use "\country_level_data"
*replace amount_usd=amount_usd/1000000
*gen amount_usd_log=amount_usd+1
*replace amount_usd_log = log(amount_usd_log)

sum str_partnership democracy taiwan  agree_us agree_cn  chinese_exports total_deaths_log gdp_per_capita_log if donor_code  ==1

mdesc str_partnership democracy taiwan  agree_us agree_cn chinese_exports total_deaths_log gdp_per_capita_log if donor_code  ==1


*Table 5. China's and Taiwan's Foreign Aid Drivers during the COVID-19 Pandemic

use "\country_level_data"

sort country
by country: egen total_china = total(amount_usd) if donor_code!=100
gen total_china_ln=log(total_china+1)

reg total_china_ln  str_partnership democracy taiwan  agree_us  chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==1 ,  vce(r)
estimates store m1
reg customs_log   str_partnership democracy taiwan   agree_us   chinese_exports_log  total_deaths_log gdp_per_capita_log if donor_code==1 ,  vce(r)
estimates store r1
reg amount_usd_log   str_partnership democracy taiwan   agree_us  chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==1 ,  vce(r)
estimates store m2
reg amount_usd_log   str_partnership democracy taiwan  agree_us  chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==2 ,  vce(r)
estimates store m3
reg amount_usd_log   str_partnership democracy taiwan  agree_us   chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==3 ,  vce(r)
estimates store m4
reg amount_usd_log   str_partnership democracy taiwan  agree_us    chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==5 ,  vce(r)
estimates store m5
reg amount_usd_log   str_partnership democracy taiwan  agree_us   chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==7 ,  vce(r)
estimates store m6
reg amount_usd_log   str_partnership democracy taiwan  agree_us  chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==100 ,  vce(r)
estimates store m7

esttab m1 r1 m2 m3 m4 m5 m6 m7, r2 se

* Figure 3. Linear prediction of the strategic partnership status on Chinese aid
use "\country_level_data"

sort country
by country: egen total_china = total(amount_usd) if donor_code!=100
gen total_china_ln=log(total_china+1)
reg total_china_ln  str_partnership democracy taiwan  agree_cn chinese_exports total_deaths_log gdp_per_capita_log if donor_code==1 ,  vce(r)

margins, at(str_partnership=(0(1)3))
marginsplot, scheme(plotplain) recast(scatter)

* Figure 4. Linear prediction of the One China Policy on Chinese and Taiwanese aid
use "\country_level_data"
sort country
by country: egen total_china = total(amount_usd) if donor_code!=100
gen total_china_ln=log(total_china+1)

reg total_china_ln  str_partnership democracy taiwan   agree_cn chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==1 ,  vce(r)
margins, at(taiwan=(0(1)1)) 
marginsplot, name(mp1, replace) scheme(plotplain) recast(scatter)

reg amount_usd_log   str_partnership democracy taiwan  agree_cn chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==100 ,  vce(r)
margins, at(taiwan=(0(1)1)) 
marginsplot, name(mp4, replace) scheme(plotplain) recast(scatter)

graph combine mp1 mp4, ycommon name(g2, replace) scheme(plotplain) 

* Figure 5. Linear prediction of the democratic regime of the recipient in China´s central government mask diplomacy
use "\country_level_data"
reg total_china_ln   str_partnership democracy taiwan   agree_cn chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==1 ,  vce(r)
margins, at(democracy=(0(1)3))
marginsplot, scheme(plotplain) recast(scatter)

*ONLINE APPENDIX

*Table F. China's and Taiwan's Foreign Aid Drivers during the COVID-19 Pandemic with Jacknife resampling

use "country_level_data"

sort country
by country: egen total_china = total(amount_usd) if donor_code!=100
gen total_china_ln=log(total_china+1)

reg total_china_ln  str_partnership democracy taiwan   agree_us  chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==1 ,  vce(jack)
estimates store m1
reg customs_log   str_partnership democracy taiwan   agree_us   chinese_exports_log  total_deaths_log gdp_per_capita_log if donor_code==1 ,  vce(jack)
estimates store r1
reg amount_usd_log   str_partnership democracy taiwan   agree_us  chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==1 ,  vce(jack)
estimates store m2
reg amount_usd_log   str_partnership democracy taiwan  agree_us  chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==2 ,  vce(jack)
estimates store m3
reg amount_usd_log   str_partnership democracy taiwan  agree_us   chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==3 ,  vce(jack)
estimates store m4
reg amount_usd_log   str_partnership democracy taiwan  agree_us    chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==5 ,  vce(jack)
estimates store m5
reg amount_usd_log   str_partnership democracy taiwan  agree_us   chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==7 ,  vce(jack)
estimates store m6
reg amount_usd_log   str_partnership democracy taiwan  agree_us  chinese_exports_log total_deaths_log gdp_per_capita_log if donor_code==100 ,  vce(jack)
estimates store m7

esttab m1 r1 m2 m3 m4 m5 m6 m7, r2 se




